﻿<Page x:Class="MediaLibrary.VideoPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="VideoPage">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>

        <TabControl Grid.Row="0" Grid.Column="0" Background="Transparent">
            <TabItem Header="all videos view" Background="Transparent" FontSize="14">
                <DataGrid 
                    x:Name="videoListBox" 
                    HeadersVisibility="Column" 
                    SelectionMode="Extended" 
                    AutoGenerateColumns="False" 
                    Background="White" 
                    GridLinesVisibility="None" 
                    RowStyle="{StaticResource dataGridRowStyle}"
                    SelectionChanged="allVideoListBox_SelectionChanged" 
                    Grid.Row="1" 
                    Grid.Column="0">
                    
                    <DataGrid.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="Add to Now Playing" Click="addToNowPlayingAllVideo_OnClick" />
                            <MenuItem Header="Replace now playing with selection" Click="replaceNowPlayingAllVideo_OnClick" />
                            <Separator />
                            <MenuItem Header="Playlists">
                                <MenuItem Header="Add to New Playlist" Click="addToNewPlaylistAllVideo_OnClick" />
                                <MenuItem Header="Add to Playlist" Click="addToPlaylistAllVideo_OnClick" />
                            </MenuItem>
                            <Separator />
                            <MenuItem Header="Delete">
                                <MenuItem Header="Delete from Library" Click="deleteFromLibraryAllVideo_OnClick" />
                                <MenuItem Header="Delete from Library and Computer" Click="deleteFromLibraryComputerAllVideo_OnClick" />
                            </MenuItem>
                        </ContextMenu>
                    </DataGrid.ContextMenu>

                    <DataGrid.Columns>
                        <DataGridTextColumn Header="title" Binding="{Binding Tag.Title}" IsReadOnly="True" HeaderStyle="{StaticResource dataGridHeaderStyle}" />
                        <DataGridTextColumn Header="play count" Binding="{Binding PlayCount}" IsReadOnly="True" HeaderStyle="{StaticResource dataGridHeaderStyle}" />
                        <DataGridTextColumn Header="rating" Binding="{Binding Tag.Rating}" IsReadOnly="True" HeaderStyle="{StaticResource dataGridHeaderStyle}" />
                        <DataGridTextColumn Header="path" Binding="{Binding Path}" IsReadOnly="True" HeaderStyle="{StaticResource dataGridHeaderStyle}" />
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>

            <TabItem Header="folder view" Background="Transparent" FontSize="14">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="300" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>

                    <TreeView x:Name="videoTreeView2" Grid.Column="0">
                        <TreeView.ContextMenu>
                            <ContextMenu>
                                <MenuItem Header="Add to Now Playing" Click="addToNowPlayingTreeView2_OnClick" />
                                <MenuItem Header="Replace now playing with selection" Click="replaceNowPlayingTreeView2_OnClick" />
                                <Separator />
                                <MenuItem Header="Playlists">
                                    <MenuItem Header="Add to New Playlist" Click="addToNewPlaylistTreeView2_OnClick" />
                                    <MenuItem Header="Add to Playlist" Click="addToPlaylistTreeView2_OnClick" />
                                </MenuItem>
                                <Separator />
                                <MenuItem Header="Delete">
                                    <MenuItem Header="Delete from Library" Click="deleteFromLibraryTreeView2_OnClick" />
                                    <MenuItem Header="Delete from Library and Computer" Click="deleteFromLibraryComputerTreeView2_OnClick" />
                                </MenuItem>
                            </ContextMenu>
                        </TreeView.ContextMenu>
                    </TreeView>
                    
                    <DataGrid 
                        x:Name="videoListBox2" 
                        Grid.Column="1"
                        HeadersVisibility="Column" 
                        SelectionMode="Extended" 
                        AutoGenerateColumns="False" 
                        Background="White" 
                        RowStyle="{StaticResource dataGridRowStyle}"
                        GridLinesVisibility="None" 
                        SelectionChanged="allVideoListBox2_SelectionChanged">
                        <DataGrid.ContextMenu>
                            <ContextMenu>
                                <MenuItem Header="Add to Now Playing" Click="addToNowPlayingVideoListBox2_OnClick" />
                                <MenuItem Header="Replace now playing with selection" Click="replaceNowPlayingVideoListBox2_OnClick" />
                                <Separator />
                                <MenuItem Header="Playlists">
                                    <MenuItem Header="Add to New Playlist" Click="addToNewPlaylistVideoListBox2_OnClick" />
                                    <MenuItem Header="Add to Playlist" Click="addToPlaylistVideoListBox2_OnClick" />
                                </MenuItem>
                                <Separator />
                                <MenuItem Header="Delete">
                                    <MenuItem Header="Delete from Library" Click="deleteFromLibraryVideoListBox2_OnClick" />
                                    <MenuItem Header="Delete from Library and Computer" Click="deleteFromLibraryComputerVideoListBox2_OnClick" />
                                </MenuItem>
                            </ContextMenu>
                        </DataGrid.ContextMenu>

                        <DataGrid.Columns>
                            <DataGridTextColumn Header="title" Binding="{Binding Tag.Title}" IsReadOnly="True" HeaderStyle="{StaticResource dataGridHeaderStyle}" />
                            <DataGridTextColumn Header="play count" Binding="{Binding PlayCount}" IsReadOnly="True" HeaderStyle="{StaticResource dataGridHeaderStyle}" />
                            <DataGridTextColumn Header="rating" Binding="{Binding Tag.Rating}" IsReadOnly="True" HeaderStyle="{StaticResource dataGridHeaderStyle}" />
                            <DataGridTextColumn Header="path" Binding="{Binding Path}" IsReadOnly="True" HeaderStyle="{StaticResource dataGridHeaderStyle}" />
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>
        </TabControl>
        <Grid Grid.Row="1" Margin="0,5,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="85" />
                <ColumnDefinition Width="90" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Button x:Name="refreshButton" Grid.Column="0" Click="refreshButton_Click">Refresh Library</Button>

            <Label x:Name="videoCounterLabel" Grid.Column="1" />

            <Label x:Name="currentlyScanning" Grid.Column="2" HorizontalAlignment="Right" Margin="0,0,0,0" />
        </Grid>
    </Grid>
</Page>
